package com.xgd.phylw.service.impl;

import com.xgd.phylw.bean.Hall;
import com.xgd.phylw.mapper.HallMapper;
import com.xgd.phylw.service.HallService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class HallServiceImpl implements HallService {
    @Autowired
    private HallMapper hallMapper;

    public List<Hall> SelectAllHall() {
        return hallMapper.selectAllHall();
    }

    public List<Hall> ScheduleAll(String name) {
        return hallMapper.LikeHall("%"+name+"%");
    }

    public int UpdateHall(Hall hall) {
        return hallMapper.updateByPrimaryKey(hall);
    }

    public Hall selectByPrimaryKey(Integer hallId) {
        return hallMapper.selectByPrimaryKey(hallId);
    }

    public int addHall(Hall hall) {
        return hallMapper.insert(hall);
    }
}
